package com.dzsw.javabase.environment;

public class CheckSystemSample {

    public static void main(String[] args) {
        String osName = System.getProperty("os.name").toLowerCase();
        System.out.println(osName);
        if (osName.contains("windows")) {
            System.out.println("操作系统是Windows");
        } else if (osName.contains("linux")) {
            System.out.println("操作系统是Linux");
        } else {
            System.out.println("操作系统不是Windows或Linux");
        }
    }
}
